import 'package:card_swiper/card_swiper.dart';
import 'package:flutter/material.dart';

class HomePage2 extends StatefulWidget {
  const HomePage2({super.key});

  @override
  State<HomePage2> createState() => _HomePage2State();
}

class _HomePage2State extends State<HomePage2> {
  late List<String> images = [
    "https://bootx-video.oss-cn-hangzhou.aliyuncs.com/827334426378013.png",
    "https://bootx-video.oss-cn-hangzhou.aliyuncs.com/378141232757511.png",
    "https://bootx-video.oss-cn-hangzhou.aliyuncs.com/292057388856882.png"
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Swiper(
        itemBuilder: (context, index) {
          final image = images[index];
          return Image.network(
            image,
            fit: BoxFit.fill,
          );
        },
        autoplay: true,
        itemCount: images.length,
        pagination: SwiperPagination(
          builder: SwiperCustomPagination(builder: (context, config) {
            return Container();
          }),
        ),
        control: NoControl(),
      ),
    );
  }
}

class NoControl extends SwiperPlugin {
  @override
  Widget build(BuildContext context, SwiperPluginConfig config) {
    return Container(); // 返回空的 Container 来隐藏控制按钮
  }
}
